//
//  BaseRequest.h
//  Cycling
//
//  Created by cjg.mini on 2023/3/2.
//

#import <Foundation/Foundation.h>
#import "AFNetworking.h"
#import <UIKit/UIKit.h>
#import "BaseHttpManager.h"
#import "BaseRequestApi.h"
#import "Public.h"
#import "UserModel.h"

typedef void(^BaseResultBlock)(id _Nullable resultObject , NSError * _Nullable error);
typedef void(^BaseProgressBlock)(NSProgress * _Nonnull downloadProgress);
typedef void(^BaseDownloadResultBlock)(id _Nullable resultObject, NSURL * _Nullable path, NSURLResponse * _Nullable response);

NS_ASSUME_NONNULL_BEGIN

@interface BaseRequest : NSObject

#pragma mark -- post请求
//post带数据请求 -- 1.请求地址 2.是否缓存 3.超时loading 4.参数 5.数据 6. 结果
+ (void)basePOST:(NSString *)url cache:(BOOL)cache autoHideLoading:(BOOL)hide parms:(id)parms data:(NSData *)data result:(BaseResultBlock)resultBlock;
//post常规请求 -- 1.请求地址 2.是否缓存 3.超时loading 4.参数 5. 结果
+ (void)basePOST:(NSString *)url cache:(BOOL)cache autoHideLoading:(BOOL)hide parms:(id)parms result:(BaseResultBlock)resultBlock;
//post后台返回非json请求 -- 1.请求地址 2.是否缓存 3.超时loading 4.参数 5. 结果
+ (void)basePOST_New:(NSString *)url cache:(BOOL)cache autoHideLoading:(BOOL)hide parms:(id)parms result:(BaseResultBlock)resultBlock;

#pragma mark -- get请求
//get请求后台返回json类型 ---- 1.请求地址 2.是否缓存 3.超时loading 4.参数 5. 结果
+ (void)baseGET:(NSString *)url cache:(BOOL)cache autoHideLoading:(BOOL)hide parms:(id)parms request:(BaseResultBlock)resultBlock;
//get请求后台返回非json类型 --- 1.请求地址 2.是否缓存 3.超时loading 4.参数 5. 结果
+ (void)baseGET_New:(NSString *)url cache:(BOOL)cache autoHideLoading:(BOOL)hide parms:(id)parms request:(BaseResultBlock)resultBlock;

#pragma mark --- 下载
+ (void)baseDownLoad:(NSString *)url cache:(BOOL)cache autoHideLoading:(BOOL)hide parms:(id)parms progess:(BaseProgressBlock)progressBlock result:(BaseResultBlock)resultBlock;
#pragma  mark --- 上传文件
+ (void)baseUpload:(NSString *)url parms:(id)parms imageList:(NSArray <UIImage *> *)imageList cache:(BOOL)cache autoHideLoading:(BOOL)hide progress:(BaseProgressBlock)progressBlock result:(BaseResultBlock)resultBlock;
#pragma mark --- 检测网络状态
+ (void)checkoutNetWorkStatus:(void(^)(AFNetworkReachabilityStatus status))block;

@end

NS_ASSUME_NONNULL_END
